package com.thinkpadteam.edugra;

import com.thinkpadteam.edugra.R;
import com.thinkpadteam.edugra.R.layout;
import com.thinkpadteam.edugra.game.GameBerhitung;
import com.thinkpadteam.edugra.game.GameMencocokkan;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageButton;
import android.widget.Toast;

public class MainGameActivity extends Activity{
	private ImageButton berhitung, mencocokkan;
	String called_from="";
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main_game);
		berhitung = (ImageButton)findViewById(R.id.btn_play_berhitung);
		mencocokkan = (ImageButton)findViewById(R.id.btn_play_mencocokkan);
		
		called_from = getIntent().getStringExtra("skor");
//		Toast.makeText(MainGameActivity.this, called_from, Toast.LENGTH_SHORT).show();
	}
	
	public void ChooseGameClikcMethod(View v){
		Intent intent;
		switch (v.getId()) {
		case R.id.btn_play_berhitung:
			intent = new Intent(this, GameBerhitung.class);
			intent.putExtra("kategori", "kosong");
			intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
			startActivity(intent);
			finish();
			break;
		case R.id.btn_play_mencocokkan:
			intent = new Intent(this, GameMencocokkan.class);
			intent.putExtra("kategori", "kosong");
			intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
			startActivity(intent);
			finish();
			break;
		case R.id.homemaingame :
			intent = new Intent(this, MainActivity.class);
			startActivity(intent);
			finish();
			break;
		default:
			break;
		}
	}
}
